package com.alibaba.dongbao.utils.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Mr.ZJW
 * @Date: 2022-04-06 9:04
 * @Description:
 */
@Configuration
@MapperScan("com.alibaba.dongbao.mapper")
//@MapperScan("com.geesun.mapper")//扫描 持久层 接口 包
public class MybatisPlusConfig  {

    /**
     *  启用MybatisPlus插件
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //启用分页插件
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}


